#include "addathlete.h"
#include "ui_addathlete.h"

addAthlete::addAthlete(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::addAthlete)
{
    ui->setupUi(this);

    this->setWindowTitle("参赛运动员注册");
    this->setWindowFlags(Qt::WindowCloseButtonHint);
}

addAthlete::~addAthlete()
{
    delete ui;
}

QString addAthlete::getAthleteName()
{
    return m_athleteName;
}

QString addAthlete::getCode()
{
    return m_code;
}

QString addAthlete::getMedalDate()
{
    return m_medalDate;
}

QString addAthlete::getMedalLevel()
{
    return m_medalLevel;
}

QString addAthlete::getEventName()
{
    return m_eventName;
}

QString addAthlete::getScore()
{
    return m_score;
}

QString addAthlete::getCountry_name()
{
    return m_country_name;
}

void addAthlete::setCountryName(QString name)
{
    ui->lineEdit_7->setText(name);
}

void addAthlete::on_pushButton_clicked()
{
    m_athleteName = ui->lineEdit->text();
    m_code = ui->lineEdit_2->text();
    m_medalDate = ui->lineEdit_4->text();
    m_medalLevel = ui->lineEdit_3->text();
    m_eventName = ui->lineEdit_5->text();
    m_score = ui->lineEdit_6->text();
    m_country_name = ui->lineEdit_7->text();

    this->accept();
}

void addAthlete::on_pushButton_2_clicked()
{
    this->reject();
}
